{include file="public/header" /}
<link rel="stylesheet" href="{$Think.ADMIN_SITE_ROOT}/css/cart.css">

<div class="page">
<!--    <div class="fixed-bar">-->
<!--        <div class="item-title">-->
<!--            <div class="subject">-->
<!--                <h3>添加线下订单</h3>-->
<!--                <h5></h5>-->
<!--            </div>-->
<!--        </div>-->
<!--    </div>-->
    <div style="float: left;width: 80%;box-sizing:border-box">
        <div class="sc-search-form">
            <div style="float: left;width: 40%;overflow: hidden">
                <div style="overflow: hidden">
                    <div class="btn_group">
                        <!-- 通过扫描枪添加商品、商品数量 -->
                        <input type="text" class="add_goods_id" class="txt" placeholder="请扫描商品条形码">
                        <input type="hidden" class="add_goods_num" class="txt" placeholder="请输入商品数量">
                        <button type="button" id="add_goods" class="btn">扫描商品</button>
                    </div>
                </div>
                <div id="goods_detail" style="overflow: hidden;margin-top: 12px;">
                </div>
            </div>
            <div style="float: left;width: 60%;overflow: hidden">
                <div style="overflow: hidden">
                    <div class="btn_group">
                        <dl>
                            <dd id="member_card_show">
                                {sctaglib:dcselect list="[$Request.param.buyer_name=>$Request.param.buyer_name]" class="w-100 sc-select-filter form-control" id="ser_member_id" name="buyer_name" key="member_id" value="$Request.param.buyer_name" default="-- --" url=":url('dictionary/query',['dict_type'=>'member_name_mobile'])" /}
                                <!-- 刷卡方式获取用户会员号、账户余额 -->
                                <input type="text" class="show_admin_member" class="txt" placeholder="请刷卡">
                                <button type="button" id="show_sc_info" class="btn">刷卡</button>
                            </dd>
                            <dd style="height: 34px;line-height: 34px">
                                <input type="checkbox" name="niming" id="niming">非会员
                            </dd>
                            <dd style="border-right: 1px solid black;">&nbsp;</dd>
                            <dd style="height: 34px;line-height: 34px">
                                <input type="radio" name="pay_type_radio" value="1" checked>余额
                                <input type="radio" name="pay_type_radio" value="2">充值卡
                                <input type="radio" name="pay_type_radio" value="3">支付宝
                                <input type="radio" name="pay_type_radio" value="4">微信
                            </dd>
                        </dl>
                    </div>
                </div>
                <div id="show_member" style="overflow: hidden;margin-top: 12px;"></div>
            </div>
        </div>
        <div style="overflow: hidden">
            <div class="btn_group" style="float: right">
                <dl>
                    <dd>
                        商品总价：共计<span class="goods_totalprice">0</span>元&nbsp;
                        <button type="button" id="submitBtn_pay" class="btn">生成订单并结算</button>

                    </dd>
                </dl>
            </div>
        </div>

        <form method="post" id="mg_form" name="mg_form" enctype="multipart/form-data" action="{:url('order/create_offline_order_pay')}">
            <input type="hidden" id="member_id" name="member_id">
            <input type="hidden" id="pay_type" name="pay_type" value="1">
            <input type="hidden" id="authcode" name="authcode">
            <input type="hidden" id="anonymous" name="anonymous">
            <!--<table class="sc-default-table">-->
            <table class="dsc-table-style" sc_type="table_cart" style="margin-top: 20px">
                <thead>
                <tr class="thead">
                    <th class="align-center" style="text-align: center">商品货号</th>
                    <th class="align-center" style="text-align: center">商品名称</th>
                    <th class="align-center" style="text-align: center">单价(元)</th>
                    <th class="align-center" style="text-align: center">数量</th>
                    <th class="align-center" style="text-align: center">小计</th>
                    <th class="align-left"  style="text-align: center">操作</th>
                </tr>
                </thead>
                <!-- 一般贸易 -->
                <tr id="trade_nomal" hidden>
                <tr id="t_nomal" hidden style="text-align: left">
                    <td colspan="6" style="text-align: left;padding-left: 2%">一般贸易</td>
                </tr>
                <tbody id="trade_nomal_tbody">
                <tr style="display: none">
                </tr>
                </tbody>
                </tr>
                <!-- 保税仓发货 -->
                <tr class="sc-default-table" id="trade_bbc" hidden>
                <tr id="t_bbc" hidden>
                    <td>保税仓发货</td>
                </tr>
                <tbody id="trade_bbc_tbody">
                <tr style="display: none;">
                </tr>
                </tbody>
                </tr>
                <!-- 跨境直邮 -->
                <tr class="sc-default-table" id="trade_bc" hidden>
                <tr id="t_bc" hidden>
                    <td class="text-left pl20">跨境直邮</td>
                </tr>
                <tbody id=trade_bc_tbody">
                <tr style="display: none">
                </tr>
                </tbody>
                </tr>
            </table>
        </form>

        <script type="text/javascript">

            $(function () {

                // //全屏
                // function fullScreen() {
                //     var element = document.documentElement;
                //     if (element.requestFullscreen) {
                //         element.requestFullscreen();
                //     } else if (element.msRequestFullscreen) {
                //         element.msRequestFullscreen();
                //     } else if (element.mozRequestFullScreen) {
                //         element.mozRequestFullScreen();
                //     } else if (element.webkitRequestFullscreen) {
                //         element.webkitRequestFullscreen();
                //     }
                // }
                //
                // //退出全屏
                // function exitFullscreen() {
                //     if (document.exitFullscreen) {
                //         document.exitFullscreen();
                //     } else if (document.msExitFullscreen) {
                //         document.msExitFullscreen();
                //     } else if (document.mozCancelFullScreen) {
                //         document.mozCancelFullScreen();
                //     } else if (document.webkitExitFullscreen) {
                //         document.webkitExitFullscreen();
                //     }
                // }

                // 如果支付方式发生改变
                $('input[type=radio][name=pay_type_radio]').change(function() {
                    if($(this).val() < 1 || $(this).val() > 4){
                        $("#pay_type").val("1");
                    }else{
                        $("#pay_type").val($(this).val());
                    }
                });

                let trade_mode_table = ''

                // 点击按钮提交
                $("#add_goods").click(function () {
                    get_goods_info($('.add_goods_id').val());
                });

                // 扫码自动提交
                $(".add_goods_id").keypress(function(event){
                    var keycode = (event.keyCode ? event.keyCode : event.which);
                    if(keycode == '13'){
                        get_goods_info($('.add_goods_id').val());
                    }
                });

                //以特定字符结尾自动提交
                $(".add_goods_id").change(function(){
                    let add_goods_id = $(this).val();
                    let target = "\n";
                    let reg = new RegExp('^.*' + target + '$');
                    if(reg.test(add_goods_id)){
                        get_goods_info(add_goods_id.substr(0,add_goods_id.length-target.length));
                    }
                });

                // 获取商品信息
                function get_goods_info(add_goods_id){
                    // let add_goods_id  = $('.add_goods_id').val(); // 扫描枪扫描商品编号
                    let add_goods_num = $('.add_goods_num').val() // 输入的商品数量
                    add_goods_num = add_goods_num ? add_goods_num : 1
                    let obj = '#exist_goods_id_' + add_goods_id   // 购物车中已存在商品记录的td编号

                    let goods_totalprice = $(".goods_totalprice").text()

                    // 判断是否有输入
                    if (add_goods_id) {
                        // 输入商品id，查询商品详情
                        let url = "{:url('Goods/get_goods_info')}"
                        let param = {'goods_id': add_goods_id}

                        // 开启遮罩层
                        let loading = layer.load(1, { shade: [0.1, '#fff'] })
                        $.getJSON(url, param, function (result) {
                            layer.close(loading) // 关闭遮罩层
                            // 清除商品货号
                            $(".add_goods_id").val("");
                            if (result.code == 1) {

                                let goods_data = result.data.goods_info
                                let goods_id = goods_data.goods_info.goods_id
                                let goods_img   = goods_data.goods_img              // 商品图片
                                let goods_name  = goods_data.goods_info.goods_name  // 商品名称
                                let goods_price = goods_data.goods_info.goods_price // 商品价格

                                let goods_gc_name    = goods_data.goods_info.gc_name    // 商品分类
                                let goods_brand_name = goods_data.goods_info.brand_name // 商品品牌
                                let trade_mode       = goods_data.goods_info.trade_mode // 一般贸易 || 保税仓

                                // 判断购物车中商品的td编号 是否存在，若存在，则对应商品的数量加一，否则在页面追加一条该商品记录
                                if(!$(obj).html()) {

                                    // 商品小计 计算单条商品总价
                                    let subtotal = floatObj.multiply(goods_price, add_goods_num)

                                    let trade_tbody = ''
                                    trade_tbody = "<tr class=\"hover edit exist_goods\" id=\"exist_goods_id_" + add_goods_id + "\" style=\"text-align: center\"'>"

                                    // trade_tbody += "<td><input type=\"checkbox\" class='checkbox_goods' value=" + add_goods_id + "></td>"

                                    trade_tbody += "<td>" + add_goods_id + "</td>"

                                    trade_tbody += "<td>"
                                    trade_tbody += "<input type=\"hidden\" name=\"goods_id[]\" value=" + goods_id + " />" // 商品id 需要提交
                                    trade_tbody += "<span class=\"thumb size-56x56\"><img src=\"" + goods_img + "?{:microtime()}\"  width=\"44\" height=\"44\"/></span>"
                                    trade_tbody += "<dl>"
                                    trade_tbody += "<dd class=\"goods-name\">" + goods_name + "</dd>" // 商品名
                                    trade_tbody += "<dd class=\"goods-store\"> <span class=\"presell\" title=\"商品类型\"></span></dd>"
                                    // trade_tbody += "<dd><span>" + trade_mode + "</span></dd>" // 一般贸易 || 保税仓
                                    trade_tbody += "</dl>"
                                    trade_tbody += "</td>"

                                    // trade_tbody += "<td>"
                                    // trade_tbody += "<dl>"
                                    // trade_tbody += "<dt class=\"gc_name\">" + goods_gc_name + "</dt>" // 商品分类
                                    // trade_tbody += "<dt class=\"brand_name\">" + goods_brand_name + "</dt>" // 商品品牌
                                    // trade_tbody += "</dl>"
                                    // trade_tbody += "</td>"

                                    trade_tbody += "<td class=\"price\">" + goods_price + "</td>" // 商品价格

                                    trade_tbody += "<td class=\"num\">"
                                    trade_tbody += "<button type='button' onclick=\"decrease_quantity(this);\"  class=\"add-substract-key tip\">-</button>"
                                    trade_tbody += "<input style=\"width: 20px;\" name=\"num_input[]\" value=\"" + add_goods_num + "\" >"
                                    trade_tbody += "<button type='button' onclick=\"add_quantity(this);\" class=\"add-substract-key tip\">  +</button>"
                                    trade_tbody += "</td>" // 商品数量 需要提交

                                    trade_tbody += "<td class=\"subtotal\">" + subtotal + "</td>" // 商品小计

                                    trade_tbody += "<td><a class=\"dsui-btn-del\" onclick=\"remove_tr($(this));\" href=\"JavaScript:void(0);\">删除</a></td>"

                                    trade_tbody += "</tr>"


                                    // 判断是否trade_mode 1：一般贸易 2：保税仓发货 3：跨境直邮
                                    if(trade_mode === 1) {
                                        trade_mode_table = '#trade_nomal_tbody'
                                        $('#trade_nomal').show()
                                        $('#t_nomal').show()
                                    }
                                    if(trade_mode === 2) {
                                        trade_mode_table = '#trade_bbc_tbody'
                                        $('#trade_bbc').show()
                                        $('#t_bbc').show()
                                    }
                                    if(trade_mode === 3) {
                                        trade_mode_table = '#trade_bc_tbody'
                                        $('#trade_bc').show()
                                        $('#t_bc').show()
                                    }

                                    $(trade_mode_table + ' > tr:last').after(trade_tbody.replace(/key/g, i))

                                    // 购物车中商品总价 + 新增商品单价*新增商品数量
                                    goods_totalprice = floatObj.add(goods_price, goods_totalprice)
                                    $(".goods_totalprice").text(goods_totalprice)
                                    // return
                                } else { // 购物车中已存在该商品

                                    let old_subtotal =  $(obj).find('.subtotal').text() // 原小计金额

                                    let exist_goods_number = parseInt($(obj).find('.num input').val())

                                    let goods_num = floatObj.add(add_goods_num, exist_goods_number)

                                    $(obj).find('.num input').val(goods_num)

                                    let subtotal = floatObj.multiply(goods_price, goods_num, 2)

                                    $(obj).find('.subtotal').text(subtotal)

                                    // 购物车中商品总价 // TODO: 计算商品总价 应该在最开始获取一次商品总价，和小计， 这里进行总价-小计+新计算的小计
                                    let subtract_value = floatObj.subtract(goods_totalprice, old_subtotal)
                                    let add_value = floatObj.add(subtract_value, subtotal)
                                    $(".goods_totalprice").text(add_value)
                                    // return
                                }
                                // 将商品信息展示到扫描商品下方
                                // $("#goods_detail").html("<dl><dd><img width='30px' src=\""+goods_img+"\" /></dd><dd>"+goods_name+"</dd><dd>"+goods_gc_name+"</dd><dd>"+goods_price+"</dd></dl>");
                                $("#goods_detail").html("<div style=\"overflow:hidden\"><dl><dd><img width='30px' src=\""+goods_img+"\" /></dd><dd>"+goods_name+"</dd></dl></div><div><dl><dd>价格："+goods_price+"</dd></dl></div>");
                                return
                            }
                            return layer.msg(result.msg, { time: 1000 })
                        })

                    }
                    return
                }

                // 点击按钮提交
                $("#show_sc_info").click(function () {
                    get_member_info("{:url('Rechargecard/get_rechargecard_info')}",$('.show_admin_member').val());
                })

                // 扫码自动提交
                $(".show_admin_member").keypress(function(event){
                    var keycode = (event.keyCode ? event.keyCode : event.which);
                    if(keycode == '13'){
                        get_member_info("{:url('Rechargecard/get_rechargecard_info')}",$('.show_admin_member').val());
                    }
                });

                //以特定字符结尾自动提交
                $(".show_admin_member").change(function(){
                    let rc_sn = $(this).val();
                    let target = "\n";
                    let reg = new RegExp('^.*' + target + '$');
                    if(reg.test(rc_sn)){
                        get_member_info("{:url('Rechargecard/get_rechargecard_info')}",rc_sn.substr(0,rc_sn.length-target.length));
                    }
                });


                // 如果用户名或者手机号发生改变
                $("#ser_member_id").change(function(){
                    get_member_info("{:url('Order/get_user_info_nameormobiel')}",$(this).val());
                });


                // 获取用户信息
                function get_member_info(url,rc_sn){
                    // let rc_sn = $('.show_admin_member').val()  // 会员卡卡号
                    // 判断是否有输入会员卡卡号
                    if (rc_sn) {
                        // let url = "{:url('Rechargecard/get_rechargecard_info')}"
                        let param = {'rc_sn': rc_sn}
                        // 查询商品详情
                        let show_member = ""
                        // 开启遮罩层
                        let loading = layer.load(1, { shade: [0.1, '#fff'] })
                        $.getJSON(url, param, function (result) {
                            layer.close(loading) // 关闭遮罩层
                            if (result.code == 1) {
                                // 隐藏 刷卡
                                // $('#member_card_show').hide()

                                let rechargecard_data = result.data.member_info // 会员卡信息
                                let card_num = rc_sn // 会员卡卡号
                                let member_id = rechargecard_data.member_id // 会员卡对应会员id
                                let member_name = rechargecard_data.member_name // 会员卡对应会员名称
                                let member_truename = rechargecard_data.member_truename
                                let member_available_predeposit = rechargecard_data.available_predeposit // 会员卡对应会员账户余额
                                let member_available_rc_balance = rechargecard_data.available_rc_balance

                                show_member = "<dl>"
                                show_member += "<dd class=\"card_num\">" + "会员卡号：" + card_num + "</dd>"

                                show_member += "<dd class=\"member_name\">" + "会员名称：" + member_name
                                show_member += "(真实姓名：" + member_truename + ")" +  "</dd>"

                                show_member += "<dd class=\"member_available_predeposit\">"
                                show_member += "会员账户余额：" + member_available_predeposit + "</dd>"
                                show_member += "<dd class=\"member_available_rc_balance\">"
                                show_member += "会员充值卡余额：" + member_available_rc_balance + "</dd>"
                                show_member += "</dl>"

                                $('#mg_form').find('#member_id').val(member_id)
                                // 判断查询会员卡号结果，如果成功执行，否则没变化
                                $('#show_member').html(show_member.replace(/key/g, i))
                                return
                            }
                            return layer.msg(result.msg, { time: 1000 })
                        })
                    }
                }

                // 提交生成订单信息
                $('#submitBtn_create_order').click(function () {
                    // 获取购物车中所有商品记录数
                    let goods_record_count = parseInt($('.exist_goods').length)
                    if(goods_record_count < 0) {
                        alert('无商品，无法生成订单')
                    }
                    // 购物车中存在商品记录，循环判断每条商品记录trade_mode贸易方式，如果商品类型中存在两种及以上贸易方式，则不可生成订单
                    var result = true;
                    var error = new Array();
                    $("#mg_tbody").find("[sc_type='verify']").each(function () {
                        if (result) {
                            data = $(this).val();
                            if (!data) {
                                result = false;
                                //error.push('请将信息填写完整');
                                error = '请将信息填写完整';
                            }
                            //验证类型
                            if (result) {
                                var data_str = $(this).attr('data-param');
                                if (data_str) {
                                    eval("data_str = " + data_str);
                                    switch (data_str.type) {
                                        case 'int':
                                            result = (data = parseInt(data)) > 0 ? true : false;
                                            error = (result == false) ? (data_str.name + '应为整数') : '';
                                    }
                                }
                            }
                        }
                    });
                    if (result) {
                        sc_ajaxpost_offline_order('mg_form', "1000")
                    } else {
                        layer.alert(error);
                    }
                });


                // 生成订单并结算
                $("#submitBtn_pay").click(function(){

                    // 获取购物车中所有商品记录数
                    let goods_record_count = parseInt($('.exist_goods').length)
                    if(goods_record_count <= 0) {
                        layer.alert('无商品，无法生成订单')
                        return
                    }

                    // 判断是否匿名
                    if($("#niming").is(":checked")){
                        $("#anonymous").val("1");
                    }else{
                        $("#anonymous").val("2");
                    }

                    // 购物车中存在商品记录，循环判断每条商品记录trade_mode贸易方式，如果商品类型中存在两种及以上贸易方式，则不可生成订单
                    var result = true;
                    var error = new Array();
                    $("#mg_tbody").find("[sc_type='verify']").each(function () {
                        if (result) {
                            data = $(this).val();
                            if (!data) {
                                result = false;
                                //error.push('请将信息填写完整');
                                error = '请将信息填写完整';
                            }
                            //验证类型
                            if (result) {
                                var data_str = $(this).attr('data-param');
                                if (data_str) {
                                    eval("data_str = " + data_str);
                                    switch (data_str.type) {
                                        case 'int':
                                            result = (data = parseInt(data)) > 0 ? true : false;
                                            error = (result == false) ? (data_str.name + '应为整数') : '';
                                    }
                                }
                            }
                        }
                    });
                    if (result) {
                        // 如果第三方支付则输入授权码
                        if($("#pay_type").val()==3 || $("#pay_type").val()==4) {
                            let index = layer.prompt({title: '请输入数据', formType: 1, btn:false,
                                // 这个是确定按钮的事件
                                "success":function(){
                                    // 键盘事件，判断回车
                                    $("input.layui-layer-input").on('keypress',function(e){
                                        if (e.which == 13) {
                                            let authcode_value = $(this).val();
                                            if (authcode_value == null || authcode_value == undefined || authcode_value == "") {
                                                layer.msg("请输入授权码")
                                            } else {
                                                parent.$("#authcode").val(authcode_value);
                                                layer.close(index);
                                                sc_ajaxpost_offline_order('mg_form',"2000");
                                            }
                                        }
                                    });
                                }
                            });
                        }else{
                            sc_ajaxpost_offline_order('mg_form',"2000");
                        }
                    } else {
                        layer.alert(error);
                    }
                });



                // 下滑刷新
                let range = 575;             //距下边界长度/单位px
                let num = 1;
                let page_num = 15;           // 每页显示条数
                let count = {$count};        // 数据总条数
                $("#div-rolling-load").scroll(function(){
                    let srollPos = $("#div-rolling-load").scrollTop();    //滚动条距顶部距离(页面超出窗口的高度)
                    let hei = $("#rolling-load").height()

                    // 如果当前文档高低减掉滚动条高低小于规定数
                    if(hei-srollPos<range){
                        ++num;
                        if(num*page_num<count){
                            $.getJSON('{:url("Order/get_order_history")}', {"page":num,"page_num":page_num}, function (result) {
                                if(result.code==10000){
                                    $("#table-right > tbody").append(result.result);
                                }
                            });
                        }
                    }

                });

            })


            // 减号 按钮
            function decrease_quantity (e) {
                let obj = $(e).parents('tr')
                // 购物车存在的该商品的数量
                let exist_goods_number = parseInt($(obj).find('.num input').val())
                if (exist_goods_number <= 1) {
                    // return layer.msg('商品数量不能小于1')
                    $(e).parents('tr').remove();
                }
                exist_goods_number -= 1
                $(obj).find('.num input').val(exist_goods_number)
                // 计算单条商品总价
                let subtotal = $(obj).find('.price').text() // 单价
                let card_goods_subtotal = floatObj.multiply(subtotal, exist_goods_number)
                $(obj).find('.subtotal').text(card_goods_subtotal) // 小计
                // 购物车中商品总价
                let all_goods_price = 0
                // 查询购物车中所有商品总计
                let subtotal_obj = $(".subtotal")
                subtotal_obj.each(function() {
                    let subtotal = $(this).text()
                    all_goods_price = floatObj.add(subtotal, all_goods_price)
                })
                $('.goods_totalprice').text(all_goods_price)
            }

            // 加号 按钮
            function add_quantity (e) {
                let obj = $(e).parents('tr')
                // 购物车存在的该商品的数量
                let exist_goods_number = parseInt($(obj).find('.num input').val())
                exist_goods_number += 1
                $(obj).find('.num input').val(exist_goods_number)
                // 计算单条商品总价
                let subtotal = $(obj).find('.price').text() // 单价
                let card_goods_subtotal = floatObj.multiply(subtotal, exist_goods_number)
                $(obj).find('.subtotal').text(card_goods_subtotal) // 小计
                // 购物车中商品总价
                let all_goods_price = 0
                // 查询购物车中所有商品总计
                let subtotal_obj = $(".subtotal")
                subtotal_obj.each(function() {
                    let subtotal = $(this).text()
                    all_goods_price = floatObj.add(subtotal, all_goods_price)
                })
                $('.goods_totalprice').text(all_goods_price)
            }

            function remove_tr(o) {
                let dom = o.parents('tr:first')
                let subtotal = dom.find('.subtotal').text() // 小计
                let goods_totalprice = $('.goods_totalprice').text() // 当前总价
                goods_totalprice = floatObj.subtract(goods_totalprice, subtotal) // 差额
                $('.goods_totalprice').text(goods_totalprice)
                dom.remove() // 删除当前行
            }

        </script>
    </div>

    <div style="float: left;width: 20%;box-sizing:border-box;text-align: center">
        <h3 style="margin-top: 20px;margin-bottom: 20px;">今日订单记录</h3>
        <div id="div-rolling-load" style="height:600px;text-align: center;overflow: scroll">
            <div id="rolling-load">
                <table id="table-right" class="sc-default-table" sc_type="table_cart">
                    {foreach name="list" item="v"}
                        <tr class="shop-list" style="border: none;text-align: center">
                            <td colspan="7" class="pl20" style="border: none;text-align: center">
                                <p>
                                    <a href="javascript:top.scLayerOpen('{:url('Order/show_order',['order_id'=>$v.order_id])}','查看订单-{$v.order_sn}')">{$v.order_sn}</a>
                                </p>
                                <p style="margin-top: 3px">
                                    {if condition="$v.buyer_id==10"}非会员{else /}<a href="javascript:top.scLayerOpen('{:url('Member/member',['member_id' => $v.buyer_id])}','查看会员-{$v.buyer_name}')">{$v.buyer_name}</a>{/if}
                                </p>
                            </td>
                            <td colspan="7" class="pl20" style="border: none;text-align: center">
                                <p>
                                    {if condition="$v.pd_amount>0"}
                                    余额支付
                                    {elseif condition="$v.rcb_amount>0"/}
                                    充值卡支付
                                    {else /}
                                    第三方支付
                                    {/if}
                                </p>
                                <p style="margin-top: 3px">
                                    {$v.order_amount}元
                                </p>
                            </td>
                        </tr>
                    {/foreach}
                </table>
            </div>
        </div>
    </div>
</div>
